<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_custnews.*" %>
<%@page import="java.util.*" %>
<%@page import="com.lmpop.trade.ti_channel.*" %>
<%@page import="com.lmpop.trade.ts_category.*"%>
<%@page import="com.lmpop.trade.ti_attach.Ti_attachInfo" %>

<% 
  	
	String news_id="";
	if(request.getParameter("news_id")!=null) news_id = request.getParameter("news_id");
  	
	Ti_custnewsInfo ti_newsInfo = new Ti_custnewsInfo();
  	List list = ti_newsInfo.getListByPk(news_id);
  	Hashtable map = new Hashtable();
	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
	String cust_id="",cat_attr="",state_code="",title="",content="",title_color="",content_sub="";
	String news_src="",news_key="",author="",editor="",article_cat="",is_comment="",out_link="",click_num="";
	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
  	if(map.get("ch_id_group")!=null) cat_attr = map.get("ch_id_group").toString();
  	if(map.get("state_code")!=null) state_code = map.get("state_code").toString();
  	if(map.get("title")!=null) title = map.get("title").toString();
  	if(map.get("content")!=null) content = map.get("content").toString();
  	if(map.get("title_color")!=null) title_color = map.get("title_color").toString();
  	if(map.get("content_sub")!=null) content_sub = map.get("content_sub").toString();
  	if(map.get("news_src")!=null) news_src = map.get("news_src").toString();
  	if(map.get("news_key")!=null) news_key = map.get("news_key").toString();
  	if(map.get("author")!=null) author = map.get("author").toString();
  	if(map.get("editor")!=null) editor = map.get("editor").toString();
  	if(map.get("article_cat")!=null) article_cat = map.get("article_cat").toString();
  	if(map.get("is_comment")!=null) is_comment = map.get("is_comment").toString();
  	if(map.get("out_link")!=null) out_link = map.get("out_link").toString();
  	if(map.get("click_num")!=null) click_num = map.get("click_num").toString();
  
	Ts_categoryInfo ts_categoryInfo = new Ts_categoryInfo();
	String selecttree = ts_categoryInfo.getCategoryTree("Iki043636nk503U","3",cat_attr);
	Map catMap  = ts_categoryInfo.getCatClassMap("3");
	StringBuffer output =new StringBuffer();
	if(!cat_attr.equals(""))
	{
	   String chIds[] =	cat_attr.split("\\|");	
	   for(String chId:chIds)
	   {
			 if(catMap!=null)
			 {
				if(catMap.get(chId)!=null)
				{
				  output.append(catMap.get(chId).toString()+" ");   						  
				}                  
			 
			  }                 
	    }		    
	}
    String para ="/program/admin/auditcustnews/index.jsp";
   
   //String para ="/program/admin/auditcustnews/index.jsp?s_title="+s_title+"&news_state="+news_state+"&ch_attr="+ch_attr+"&start_date="+start_date+"&end_date="+end_date+"&news_keyx="+news_keyx+"&company="+company+"&iStart="+Integer.parseInt(iStart);

  %>
<html>

<head>
    <title>审核会员资讯</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="news.js"></script>
	<script src="/js/jquery.js" type="text/javascript"></script>
	<script>
		 jQuery.noConflict();
	</script>
</head>

<body>

	<h1>审核会员资讯</h1>
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		<tr>
			<td align="right" width="15%">资讯标题<font color="red">*</font></td>
				<td colspan="3">
					<font color="<%=title_color%>"><%=title%></font>
				</td>
		</tr>
		<%
		    Ti_attachInfo ti_attachInfo = new Ti_attachInfo();
			String img_path =  ti_attachInfo.getFilePathByAttachrootid(news_id);
			if(img_path.equals(""))
			{
			    img_path ="/program/admin/images/cpwu.gif";            
			} 
		
		%>
		
		<tr>
			<td align="right" width="15%">
				资讯图片<font color="red">*</font>			
		  </td>
			<td colspan="3"><img src="<%=img_path%>" border="0" width="85" height="85" /></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">
				所属分类<font color="red">*</font>			
		  </td>
			<td colspan="3"><%=output%></td>
		</tr>
		
		<tr>
			<td align="right" width="15%">关键字:</td>
			<td colspan="3"><%=news_key%></td>
		</tr>
				
		<tr>
			<td align="right" width="15%">内容摘要:</td>
			<td colspan="3"><%=content_sub%></td>
		</tr>		
		
		
		<tr>
			<td align="right" width="15%">来源:</td>	   
			  <td width="18%"><%=news_src%></td>
			  <td width="12%" align="right">责任编辑:</td>
			  <td width="40%"><%=editor%></td>
	    </tr>
		
		<tr>
			<td align="right" width="15%">原作者:</td>
			<td>
			   <%=author%>
			</td>
		    <td align="right">文章类型:</td>
		    <td width="40%">
			<%
			  if(article_cat.equals("0"))out.print("原创");
			  if(article_cat.equals("1"))out.print("转载");
			%>
			</td>
		</tr>	
		
		
		
		<tr>
			<td align="right" width="15%">是否允许评论:</td>
			<td>
		     
			<%
			  if(is_comment.equals("0"))out.print("可以"); 
              if(is_comment.equals("1"))out.print("不可以");
			%> 
			
			</td>
		    <td align="right"></td>
		    <td width="40%">
			  
			  </td>
		</tr>
		
		<tr>
			<td align="right" width="15%">外部链接:</td>
			<td colspan="3"><%=out_link%></td>
		</tr>		
		<tr>
			<td align="right" width="15%">资讯内容<font color="red">*</font></td>
 			<td colspan="3"><%=content%></td>
		</tr>
		
		<tr>
		<td  colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">审核信息</span></td>
	    </tr>
     
        <tr>
			<td align="right" width="20%">
				是否通过:			
			</td>
			<td colspan="3">
			  <input type="radio" name="state_code" id="state_code1" onclick="change(0)" checked value="0" />审核通过
			  <input type="radio" name="state_code" id="state_code2" onclick="change(1)" value="2" />审核不通过	
			</td>
			
		</tr> 
		
		  <tr style="display:none;" id="tr_reason">
			<td align="right" width="20%">
				不通过理由:			
			</td>
			<td colspan="3">
			   <textarea name="remark" id="remark" cols="80" rows="8"></textarea>
			</td>
			
		</tr> 
		
	</table>
	
		<script>
		function change(val)
        {
			if(val == 0){
				document.getElementById('tr_reason').style.display = 'none';
			}
			if(val == 1){
				document.getElementById('tr_reason').style.display = '';
			}
	    }
		</script>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
			  <input type="hidden" name="bpm_id" value="1894" />
	  		  <input type="hidden" name="pkid" value="<%=news_id%>" />
			  <input type="hidden" name="jumpurl" value="<%=para%>" />
			<input type="button" class="buttoncss" name="tradeSub" value="提交" onClick="audit()"  />&nbsp;&nbsp;
			  <input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='<%=para%>';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
